import React, { PureComponent } from 'react'
import { Card, Button, notification, message } from 'antd'







export default class Notice extends PureComponent {

  render () {
    const openNotificationWithIcon = type => {
      notification[type]({
        message: 'Notification Title',
        description:
          'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
      });
    }

    const success = () => {
      message.success('This is a success message');
    };

    const error = () => {
      message.error('This is an error message');
    };

    const warning = () => {
      message.warning('This is a warning message');
    };
    return (
      <div>
        <Card title="状态提示框">
          <Button onClick={() => openNotificationWithIcon('success')}>Success</Button>
          <Button onClick={() => openNotificationWithIcon('info')}>Info</Button>
          <Button onClick={() => openNotificationWithIcon('warning')}>Warning</Button>
          <Button onClick={() => openNotificationWithIcon('error')}>Error</Button>
        </Card>

        <Card title="全局提示">
          <Button onClick={success}>Success</Button>
          <Button onClick={error}>Error</Button>
          <Button onClick={warning}>Warning</Button>
        </Card>
      </div>
    )
  }
}
